package com.jtlrm.ckd.mvp.view.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jtlrm.ckd.R;
import com.jtlrm.ckd.entity.YingYangHistoryEntity;

public class YingYangPingGuAdapter extends BaseQuickAdapter<YingYangHistoryEntity, BaseViewHolder> {
    public YingYangPingGuAdapter() {
        super(R.layout.yingyang_pinggu_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, YingYangHistoryEntity item) {
        try {
            if (item.isFirst()) {
                helper.getView(R.id.yuefen).setVisibility(View.VISIBLE);
                helper.setText(R.id.yuefen, item.getYueFen());
            } else {
                helper.getView(R.id.yuefen).setVisibility(View.GONE);
            }
            helper.setText(R.id.date, item.getAssessmentTime().substring(0, item.getAssessmentTime().indexOf(" ")));
            if (item.getBrId() == 1) {
                helper.setText(R.id.status, "已引用,不可编辑");
            } else if (item.getBrId() == 2) {
                helper.setText(R.id.status, "已过期,不可编辑");
            } else if (item.getBrId() == 0) {
                helper.setText(R.id.status, "未引用,可编辑或长按删除");
            }
        } catch (Exception e) {

        }

    }
}

